package cultu.common.service;

import org.granite.messaging.service.annotations.RemoteDestination;

import cultu.common.message.User;
import cultu.common.message.UserCriteria;
import cultu.common.message.UserList;
import cultu.common.message.UserScenario;
import cultu.core.message.Context;

/**
 * The Interface UserManager.
 */
@RemoteDestination(id="userManager", channel="my-amf")
public interface UserManager
{
  
  /**
   * Gets the user.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pKey the key
   * @return the user
   */
  User getUser(Context pContext, UserScenario pScenario, User pKey);

  /**
   * Creates the user.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pUser the user
   * @return the user
   */
  User createUser(Context pContext, UserScenario pScenario, User pUser);

  /**
   * Delete user.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pKey the key
   * @return the user
   */
  User deleteUser(Context pContext, UserScenario pScenario, User pKey);

  /**
   * Update user.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pUser the user
   * @return the user
   */
  User updateUser(Context pContext, UserScenario pScenario, User pUser);

  // batch methodes

  /**
   * Find users.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pCriteria the criteria
   * @return the user list
   */
  UserList findUsers(Context pContext, UserScenario pScenario, UserCriteria pCriteria);

  /**
   * Delete users.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pList the list
   * @return the user list
   */
  UserList deleteUsers(Context pContext, UserScenario pScenario, UserList pList);

  /**
   * Creates the users.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pList the list
   * @return the user list
   */
  UserList createUsers(Context pContext, UserScenario pScenario, UserList pList);

  /**
   * Update users.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pList the list
   * @return the user list
   */
  UserList updateUsers(Context pContext, UserScenario pScenario, UserList pList);
  
  /**
   * Validate account.
   *
   * @param secureKey the secure key
   * @return the user
   */
  User validateAccount(final String secureKey);
}
